package com.piggy.logi.sys.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.piggy.logi.sys.bo.LogiScheduleNodeEditBo;
import com.piggy.logi.sys.domain.LogiScheduleNode;
import com.piggy.logi.sys.mapper.LogiScheduleNodeMapper;
import com.piggy.logi.sys.service.ILogiScheduleNodeService;
import com.piggy.logi.sys.service.ILogiScheduleService;
import com.piggy.logi.sys.vo.LogiScheduleLogVo;
import com.piggy.logi.sys.vo.LogiScheduleNodeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class LogiScheduleNodeServiceImpl extends ServiceImpl<LogiScheduleNodeMapper, LogiScheduleNode> implements ILogiScheduleNodeService {

    @Resource
    private ILogiScheduleService logiScheduleService;


    @Override
    public List<LogiScheduleNodeVo> scheduleCarNodeDetail(Long scheduleId) {
        return BeanUtil.copyToList(baseMapper.selectByScheduleId(scheduleId), LogiScheduleNodeVo.class);
    }

    @Override
    public void insertBo(LogiScheduleNodeEditBo editBo) {
        save(BeanUtil.toBean(editBo, LogiScheduleNode.class));
    }
}
